package org.jsola.hr.dto;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.hibernate.validator.constraints.Length;
import org.jsola.core.dto.BaseDTO;
import org.jsola.core.validator.Const;
import org.jsola.hr.constant.SalaryPlanTypeEnum;

import javax.validation.Valid;
import javax.validation.constraints.NotNull;
import java.util.List;

import static org.jsola.core.example.BaseExample.E_ID;
import static org.jsola.core.example.BaseExample.M_ID_NOT_NULL;
import static org.jsola.core.example.BaseExample.N_ID;
import static org.jsola.hr.example.SalaryPlanExample.E_BEFORE_TAX;
import static org.jsola.hr.example.SalaryPlanExample.E_COMPANY_ID;
import static org.jsola.hr.example.SalaryPlanExample.E_ENABLE;
import static org.jsola.hr.example.SalaryPlanExample.E_NAME;
import static org.jsola.hr.example.SalaryPlanExample.E_NEXT_MONTH_CLEAR;
import static org.jsola.hr.example.SalaryPlanExample.E_REMARK;
import static org.jsola.hr.example.SalaryPlanExample.E_SYSTEM_PROPERTY;
import static org.jsola.hr.example.SalaryPlanExample.E_TYPE;
import static org.jsola.hr.example.SalaryPlanExample.M_COMPANY_ID_MAX;
import static org.jsola.hr.example.SalaryPlanExample.M_COMPANY_ID_NOT_NULL;
import static org.jsola.hr.example.SalaryPlanExample.M_NAME_MAX;
import static org.jsola.hr.example.SalaryPlanExample.M_REMARK_MAX;
import static org.jsola.hr.example.SalaryPlanExample.M_TYPE_ENUM_NOT_MATCH;
import static org.jsola.hr.example.SalaryPlanExample.N_BEFORE_TAX;
import static org.jsola.hr.example.SalaryPlanExample.N_COMPANY_ID;
import static org.jsola.hr.example.SalaryPlanExample.N_ENABLE;
import static org.jsola.hr.example.SalaryPlanExample.N_NAME;
import static org.jsola.hr.example.SalaryPlanExample.N_NEXT_MONTH_CLEAR;
import static org.jsola.hr.example.SalaryPlanExample.N_REMARK;
import static org.jsola.hr.example.SalaryPlanExample.N_SYSTEM_PROPERTY;
import static org.jsola.hr.example.SalaryPlanExample.N_TYPE;
import static org.jsola.core.example.BaseExample.*;
import static org.jsola.hr.example.SalaryPlanExample.*;

/**
 * @author zhr
 */
@EqualsAndHashCode(callSuper = true)
@ApiModel(description = "修改【工资方案】的参数")
@Data
public class SalaryPlanUpdateDTO extends BaseDTO {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(notes = N_ID, example = E_ID, required = true)
    @NotNull(message = M_ID_NOT_NULL)
    private String id;

    @ApiModelProperty(notes = N_NAME, example = E_NAME)
    @Length(max = 255, message = M_NAME_MAX)
    @NotNull
    private String name;

    @ApiModelProperty(notes = N_TYPE, example = E_TYPE, allowableValues = SalaryPlanTypeEnum.VALUES_STR)
    @Const(constClass = SalaryPlanTypeEnum.class, message = M_TYPE_ENUM_NOT_MATCH)
    private Integer type;

    @ApiModelProperty(notes = N_BEFORE_TAX, example = E_BEFORE_TAX)
    private Boolean beforeTax;

    @ApiModelProperty(notes = N_NEXT_MONTH_CLEAR, example = E_NEXT_MONTH_CLEAR)
    private Boolean nextMonthClear;

    @ApiModelProperty(notes = N_SYSTEM_PROPERTY, example = E_SYSTEM_PROPERTY)
    private Boolean systemProperty;

    @ApiModelProperty(notes = N_REMARK, example = E_REMARK)
    @Length(max = 255, message = M_REMARK_MAX)
    private String remark;

    @ApiModelProperty(notes = N_ENABLE, example = E_ENABLE)
    private Boolean enable;

    @Valid
    @ApiModelProperty(notes = N_FORMULA, example = E_FORMULA)
    private List<SalaryPlanFormulaAddDTO> salaryPlanFormulaAddDTOList;
    @ApiModelProperty(notes = N_COMPANY_ID, example = E_COMPANY_ID, required = true)
    @NotNull(message = M_COMPANY_ID_NOT_NULL)
    @Length(max = 32, message = M_COMPANY_ID_MAX)
    private String companyId;


}

